package com.bdqn.cloud.t330.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;
/*<xml>
    <bean id="restTemplate" class="org.springframework.web.client.RestTemplate" >
</xml>*/
@Configuration
public class RestConfig {

    //使用Ribbon实现负载均衡的调用
    @LoadBalanced
    @Bean
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
